/**
 * 
 */
package cz.cvut.fit.crhonjar.mi.run.hawera.tree.statement;

import cz.cvut.fit.crhonjar.mi.run.hawera.tree.TreeVisitor;
import cz.cvut.fit.crhonjar.mi.run.hawera.tree.expression.ExpressionTree;

/**
 * while internal represantation
 * 
 * 
 * @author Jarec
 * 
 */
public class WhileTree extends StatementTree {

	private ExpressionTree condition;
	private StatementTree block;

	/**
	 * constructs whileTree with condition and block
	 * 
	 * @param condition
	 * @param block
	 */
	public WhileTree(ExpressionTree condition, StatementTree block) {
		super();
		this.condition = condition;
		this.block = block;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cz.cvut.fit.crhonjar.mi.run.hawera.tree.TreeVisitorAcceptor#accept(cz
	 * .cvut.fit.crhonjar.mi.run.hawera.tree.TreeVisitor)
	 */
	@Override
	public void accept(TreeVisitor visitor) {
		visitor.visitWhile(this);

	}

	/**
	 * @return the block
	 */
	public StatementTree getBlock() {
		return this.block;
	}

	/**
	 * @return the condition
	 */
	public ExpressionTree getCondition() {
		return this.condition;
	}

}
